package workexp.alg.math;

import java.util.ArrayList;
import java.util.List;

public class FizzBuzz {
    public static final String num35 = "FizzBuzz";
    public static final String num3 = "Fizz";
    public static final String num5 = "Buzz";

    public List<String> fizzBuzz(int n) {
        List<String> result = new ArrayList<>(n);
        for(int i=1;i<=n;i++){
            if(i%3==0&&i%5==0){
                result.add(new String(num35));
            }else if(i%3==0){
                result.add(new String(num3));
            }else if(i%5==0){
                result.add(new String(num5));
            }else{
                result.add(String.valueOf(i));
            }
        }
        return result;

    }
}
